﻿using ArticleWeb.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ArticleWeb
{
    public class EnumUtil
    {
        public static List<IDName<int>> GetIDNames<T>()
        {
            var list = new List<IDName<int>>();
            var values = Enum.GetValues(typeof(T));
            foreach (var item in values)
            {
                list.Add(new IDName<int> { ID = (int)item, Name = item.ToString() });
            }
            return list;
        }
    }
}